home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / addpath.arc / ADDPATH.TXT
Encoding:
Text File  |  1986-08-19  |  2.1 KB  |  66 lines

  1.                           Adding to your PATH
  2.  
  3.  (* The following is from 'Exchange of IBM PC Information', *)ì
  4.  (* July/August 1986 from an article by Mark Chance         *)
  5.  
  6.  (**NOTE: This method of adding to your PATH is NOT DOCUMENTED in **)
  7.  (**      the DOS Reference manual and is NOT SUPPORTED by IBM.   **)
  8.  
  9.  
  10. When processing a BATch file, DOS (version 2.00 and higher) has an
  11. interesting way of accessing the information you have placed in the
  12. environment space using the DOS SET command. If you use the SET
  13. command from within a BATch file to set XXX to YYY:
  14.  
  15.   SET XXX=YYY
  16.  
  17. and then enter the XXX variable from within another BATch command as
  18. shown below:
  19.  
  20.   ECHO   %XXX%
  21.  
  22. then DOS returns YYY.
  23.  
  24. Using this information, you can create a BATch file that will add a
  25. single directory to your existing PATH statement without your havingì
  26. to re-enter each directory currently in the PATH. First, you createì
  27. a BATch file (I named mine ADDPATH.BAT) that contains the followingì
  28. command:ì
  29.  
  30.   PATH %1;%PATH%
  31.  
  32. If you create this BATch file using the COPY CON: command. type theì
  33. lines shown below from the keyboard. The word "enter" in bracketsì
  34. means you press the Enter key at the end of the line; the F6 meansì
  35.  you press Function Key 6.
  36.  
  37.   COPY CON: ADDPATH.BAT   <Enter>
  38.   PATH %1;%PATH%   <Enter>
  39.   F6    <Enter>
  40.  
  41. Suppose your current path contains the following directories:
  42.  
  43.   PATH C:\;C:\DOS;C:\UTIL;
  44.  
  45. And you wish to add the directory c:\APPS to the path. You simplyì
  46. enter the following command at the DOS prompt:ì
  47.  
  48.   ADDPATH C:\APPS
  49.  
  50. The PATH would become
  51.  
  52.   PATH C:\APPS;C:\;C:\DOS;C:\UTIL;
  53.  
  54. If you wish to add the directory to your path temporarily, you mightì
  55. consider loading COMMAND.COM as a second level command processorì
  56. before you enter the ADDPATH statement:ì
  57.  
  58.   COMMAND
  59.   ADDPATH  C:\APPS
  60.  
  61. The new path will be valid as long as you operate under the secondì
  62. level command processor. When you enter "EXIT" and return to the firstì
  63. level command processor (loaded when you booted DOS), the original
  64. PATH would again be valid.
  65.  
  66.